/**
 * 
 */
package com.wskj.library.book.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wskj.library.service.BookService;
import com.wskj.library.service.impl.BookServiceImpl;

/**
 * @author 胡洋
 * @describe  批量删除图书的信息  .....
 * @Date 2018年3月26日上午10:04:52
 * @version 1.0
 */
@WebServlet(urlPatterns="/book/deleteAll.do")
public class BookDeleteAllServlet extends HttpServlet {
	    //图书的服务类......
		private BookService bookService=new BookServiceImpl();
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String ids = req.getParameter("ids");
		String[] id = ids.split(",");
		
		boolean result=bookService.deleteBookById(id);		
		
		 resp.sendRedirect(req.getContextPath()+"/book/list.do");
		
	}
	
	
	
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	}
}
